package factory.v1;

/**
 * 水果工厂类，工厂模式的核心，负责生产各种水果
 *
 */
public class FruitFactory {
    public static Fruit makeFruit(String  name){
        if(name.equalsIgnoreCase("apple"))
            return new Apple();
        if(name.equalsIgnoreCase("banana"))
            return new Banana();

        //Kiwi
        return null;
    }

}
